package bean;

import lombok.Data;
import lombok.EqualsAndHashCode;

import static java.lang.Math.PI;

/**
 * 圆
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class Circle extends GeometricObject {
    private double radius;

    public Circle() {
        System.out.println("Circle...");
        this.radius = 1;
    }

    public Circle(double radius) {
        this.radius = radius;
    }

    public double findArea() {
        return PI * this.radius * this.radius;
    }

    @Override
    public double findPerimeter() {
        return PI * 2 * radius;
    }

    public static double findArea(double radius) {
        return PI * radius * radius;
    }
}
